<?php
/**
 * Created by PhpStorm.
 * User: Korbin
 * Date: 2018/11/10
 * Time: 11:17
 */

namespace app\script\command;

use app\common\model\Job;
use app\common\model\News;
use app\common\model\NewsContent;
use app\common\model\NewsType;
use think\console\Input;
use think\console\input\Option;
use think\console\Output;

class Kubik extends Base
{

    private $listKey = 'data';//获取数据区域
    private $startUrl = 'http://api.beritaqu.net/content/getList?base=';
    private $classNameArr=['Rekomendasi','Popular','Humor','Unik & SERU','GIF','Games','Enterainews','Bola','MotoGP','Nasional','Eat & Go','Otomotif','Lifestyle','Olahraga','Ekonomi Bisnis','Teknologi','Internasional','K-pop'];
    private $baseArr=[
        'NjQxOTBGNTVFQzNGNzBEOTE2QjRBM0Y1MjQ5ODJGQTEuY0dGeVlXMGZOR0ZpWmpCalpEZ3RaalZoWWkwME5qVXdMVGcyTjJNdE1XUmpNelEzT1Rsall6STBIblpsY25OcGIyNGZOQjV3YkdGMFptOXliUjloYm1SeWIybGsucYq6NzWvX%2BNXymqxEXMpHbWjIZ6RgZ6Rp8con22LcfOCNd5Thu6FMW7tCmqss9eYXlUE9zVBIl3bFfmjyFaCriqYkv%2FL5gFr9OLi6hAxMuwuEQGH7RktSQNtpXnDxn05l2vowcBRJVV65LWGbcikmGtbpgniy5Ebp%2F4sie5b8galvPuNgZrjjM%2FGmuwMFLUhC%2BelkUyJODpLAimnqrZvcWQiztj%2Bvfhl78htRYTFuqCufZLnFTykiFXQZpRkpjV8AFOKzW16JuB20q2omkmkfxhgN0jzMEMWMjPq2KZHD%2FhSmoeiOgF6iv1LAaNFm6M4CKzEUgIQNrq0CKb2gAhheiMvvbMEePMhc%2BfIjj2zUSmGwr22ZL%2BS%2B7fB5IAHbEV7mfOyO%2FpQcAg0et0axXFEvSIlsj00qov0cP5kE%2BFA%2BBTDeOZv9kfxA%2Fhb97vyycGR9C6QcpBg4f0pIW%2BvVtflD8B%2BNVIEcQHtYlkqNu5IYuSxTYO7bYYD%2BGGnV5VfTpBsZ1tJR9XFWSxn6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6WVRRdE4yWTBZV0l3WkRFd09Ua3hIblpsY25OcGIyNGZOQjV3YkdGMFptOXliUjloYm1SeWIybGsusoOS8RQBJzNrDRRB5SYNgFxks7p%2Bjqv4g6iOWqVeeuZ8hpya1JvlXfQRhxBHDvF00aMwT61wGLAqgNvs7KJ40Hp%2FVCsAzIcNm9HBRJmS6KUWku8wirE7asdvGIeuQqTQoPczZgXG1mw57HcemGggaVs64YsEZk3VtZu5LmIcvO%2BXqfF2%2BBhLOmD181a8ZxE7mTa5WunTpSnwk5qXURY0aDhCplmMmhLrksmJTqVcgeLLj63pg476ztu5z2j6ClBLzqCUEa9Hq3Z%2BDkXidNKc0SKxUJR93i7v%2BLSE1%2FSD1%2BuOaQiu5zpsKHX8sx5w8XXmp4kBey4GiVXP6BtUl1x7knUEys6bOJQnsoK%2FiMANo2F5jRGARHZu6gLCVhIuBUSHfxN3mZF5JTG0TgKD7pWtbV5RZ1ciZGdecydxdfIEBV3FZPLmAtfwKK8TCe2SizopBj4icEG7sbYIcKXFE9mem%2FUm5siQQhxUVOtTmLa9HbjYkhlYqLhIciG5AberP%2Fjfv5Vmhh0pbigH2DyWtvobpZ6q2iAP5Kg28YlKPE3xRr0Uq4y2yN3ndtP0iiJ38r4gX5yHm9c0ageQM4aNeEJ%2F6s0rIvKJZc3T0DVx%2FPP6%2F2aURiTmIOKU0wYUVortKq%2FoXTnYmBnbIdSnpU2jeSj9Rv27sJBImMVS48mnT%2B0BmYeSWCgLtpXIC2CaFo2iPH%2Bc%2BUWNPOeh%2FOJpQkFfvw7U8OpbAr3oBxr9xdfgZJtDhEY2xdibW%2Bt20aRyRG%2B0lpHWW7lqOMPtvy4w2vhgGZyL36m9qcBomOcMXVQx7oap%2F0N%2Fm4PgGiA00%2B7n7T5Tw22PnqmFwH2iL7A409%2BI14NYQhk%3D',
    ];
    /**
     * 设置执行名称及配置传入参数、脚本描述
     */
    protected function configure()
    {
        //设置执行名称
        $this->setName('kubikNews')
            ->addOption('job', 'j', Option::VALUE_OPTIONAL)
            ->setDescription('Run all the time');
    }

    /*********************公用验证部分************************************/
    /*
     * 执行脚本任务
     *
     * @param Input $input
     * @param Output $output
     */
    protected function execute(Input $input, Output $output)
    {
        $job = $input->getOption('job');
        if (empty($job)) {
            $output->writeln('请传入执行任务ID：' . date('Y-m-d H:i:s'));
            exit();
        }

        $output->writeln('脚本开始：' . date('Y-m-d H:i:s'));
        $jobModel = new Job();
        $jobInfo = $jobModel->where(['id' => $job])->find();//获取任务配置信息
        if (empty($jobInfo)) {
            $output->writeln('任务ID不存在：' . date('Y-m-d H:i:s'));
            exit();
        } else {
            $jobInfo = $jobInfo->toArray();
        }
        //$this->redis->hSet('job_status',$job,1);
        $jobRedisInfo = $this->redis->hGet('jobHash', $job);//获取任务redis记录
        if (empty($jobRedisInfo)) {
            $jobRedisData = [
                'planned_quantity' => $jobInfo['planned_quantity'],
                'real_quantity' => (empty($jobInfo['real_quantity']) ? 0 : $jobInfo['real_quantity']),
                'shortvideo_num' => (empty($jobInfo['shortvideo_num']) ? 0 : $jobInfo['shortvideo_num']),
                'smallvideo_num' => (empty($jobInfo['smallvideo_num']) ? 0 : $jobInfo['smallvideo_num']),
                'finsh_time' => '',
            ];
        } else {
            $jobRedisData = json_decode($jobRedisInfo, true);
            $jobRedisData['planned_quantity'] = $jobInfo['planned_quantity'];
        }
        $newsTypeId = [];
        $this->createType($jobInfo,$newsTypeId);
        //开始循环执行采集任务
        while (true) {
            //采集开始执行验证采集开关是否打开
            $jobStatus = $this->redis->hGet('job_status', $job);
            if ($jobStatus != 1) {
                break;//采集开关关闭时跳出循环结束脚本执行
            }

            foreach ($this->classNameArr as $key=>$val) {
                $url=$this->startUrl.$this->baseArr[$key];

                $result = $this->getApiData($url);//获取采集源结果

                //验证是否有相应的采集数据
                if (is_array($result)&& array_key_exists($this->listKey, $result)) {
                    $lists = $result[$this->listKey];
                } else {
                    $output->writeln($this->getName() . '采集源服务器出错或找不到采集信息！'. date('Y-m-d H:i:s'));
                    continue;
                }

                //开始拼装数据
                $insertData = [];
                if (!empty($lists)) {
                    $this->createData($lists, $jobInfo, $jobRedisData, $insertData,$newsTypeId[$val]);//对源数据进行对应入库
                    if (!empty($insertData)) {
                        //当实际采集数据大于等于计划采集数据量时设置redis开关值
                        if (($jobRedisData['planned_quantity'] - $jobRedisData['real_quantity']) <= 0) {
                            $this->redis->hSet('job_status', $job, 2);//正常完成值为2
                            $jobRedisData['finsh_time'] = date('Y-m-d H:i:s');//正常完成时间记录
                            $jobModel->save(['job_status'=>2,'status_time'=>date('Y-m-d H:i:s')],['id'=>$job]);
                        }
                        $this->redis->hSet('jobHash', $job, json_encode($jobRedisData));
                        $output->writeln('【' . $this->getName() . '采集成功】本次采集入库数据条数为【' . count($insertData) . '】'. date('Y-m-d H:i:s'));
                    } else {
                        $output->writeln('【' . $this->getName() . '执行成功】本次采集无符合要求的数据入库!'. date('Y-m-d H:i:s'));
                    }
                } else {
                    $output->writeln('【'.$this->getName().'请求成功】本次请求无返回正确数据!'.date('Y-m-d H:i:s'));
                    continue;
                }
            }

            //间隔随机时间
            $sleep = rand(5, 10);
            sleep($sleep);
        }

        $output->writeln($this->getName().'任务执行完毕：' . date('Y-m-d H:i:s'));
    }
    /*********************公用验证部分************************************/

    /**
     * 组装url进行数据获取
     * @param $url
     * @return mixed
     */
    private function getApiData($url)
    {
        $header=[
            'cache-control: no-cache',
            'User-Agent: Dalvik/2.1.0 (Linux; U; Android 6.0.1; MI 4LTE MIUI/V9.5.3.0.MXDCNFA) qukan_android',
            'base64: 1',
            'Accept: */*',
            'Connection: keep-alive',
        ];
        $result = curl_get_https($url,[],$header);
        $result = json_decode($result, true);
        return $result['data'];
    }

    /**
     * 采集数据拼装入库
     *
     * @param $lists
     * @param $jobInfo
     * @param $jobRedisData
     * @param $insertData
     * @param $typeId
     */
    private function createData($lists, $jobInfo, &$jobRedisData, &$insertData,$typeId)
    {
        $news =  new News();
        $newContent=new NewsContent();

        $contentInsertData=[];
        $updateData = [];
        $dataIds = [];
        foreach ($lists as $val) {
            if(!is_array($val)){
                continue;
            }
            $data = [];
            if(!isset($val['id'])){
                continue;
            }
            //视频评论、点赞、收藏、分享数
            $data['thumb_num'] = array_key_exists('upVoteCount',$val)?$val['upVoteCount']:0;
            $data['comment_num'] = isset($val['comment_count'])?$val['comment_count']:0;
            $data['watch_num'] = isset($val['read_count'])?$val['read_count']:0;
            $data['share_num'] = isset($val['share_count'])?$val['share_count']:0;

            //验证视频是否符合采集需求
            $validateRes = $this->validateNum($data,$jobInfo);
            if ($validateRes == false) {
                continue;
            }
            //平台信息【可不动】
            $data['job_id'] = $jobInfo['id'];
            $data['language'] = $jobInfo['lang'];
            $data['country'] = $jobInfo['country'];
            $data['platform'] = $jobInfo['platform'];
            $data['create_by'] = $jobInfo['create_by'];
            $data['create_date'] = date('Y-m-d H:i:s');
            $data['update_by'] = $jobInfo['update_by'];
            $data['update_date'] = date('Y-m-d H:i:s');
            $data['remarks'] = '';

            //新闻信息
            $data['uni'] = $val['id'];//第三方视频唯一ID
            if(in_array($data['uni'],$dataIds,true)){
                continue;
            }
            array_push($dataIds,$data['uni']);
            $data['title'] = $val['title'];//新闻标题
            $data['cover_img'] = $val['cover'][0];//封面
            $data['cover_show_type'] = $val['cover_show_type'];//封面类型

            $data['author_avatar'] = '';//作者头像
            $data['author_name'] = '';//作者姓名
            $data['create_time'] = time();//创建时间
            $data['update_time'] = time();//更新时间
            $data['href']=$val['url'];
            $data['source']=$val['source_url'];
            $data['visit_count'] = $val['read_count'];//访问数量
            $data['type_id'] = $typeId;//访问数量
            $data['like_count'] = $val['like_info']['like'];//点赞数量
            $data['comment_count'] = $val['comment_count'];//留言个数
            $data['unlike_count'] = $val['like_info']['dislike'];//
            $data['unlike_enable'] =0;//是否允许不喜欢
            $data['can_comment'] = 1;//是否允许评论,默认为1允许',
            $data['share_count'] = $val['share_count'];//分享个数
            $data['listorder'] = 0;//排序
            $data['status'] = 1;//状态:1显示,2不显示


            $dataContent = [];
            $dataContent['id'] = com_create_guid();//生成唯一UUID
            $dataContent['content']=$val['content_detail'];
            $dataContent['update_time']=time();
            $dataContent['create_by']=$data['create_by'];
            $dataContent['create_date']=date('Y-m-d H:i:s');
            $dataContent['update_by']=$data['update_by'];

            $dataContent['remarks']='';
            //判断是否 已经存在
            $isExist = $news->field('id')->where([
                'uni' => $data['uni']
            ])->find();
            if ($isExist) {
                //continue;
                $data['id'] = $isExist['id'];
                $updateData[] = $data;
            }else{
                $data['id'] = com_create_guid();//生成唯一UUID
                $jobRedisData['real_quantity'] += 1;//实际采集数量+1
                $dataContent['news_id']=$data['id'];
                $contentInsertData[]=$dataContent;
                $insertData[] = $data;
            }
        }
        $news->allowField(true)->isUpdate(true)->saveAll($updateData);
        $news->allowField(true)->isUpdate(false)->saveAll($insertData,false);
        $newContent->allowField(true)->isUpdate(false)->saveAll($contentInsertData, false);
        $insertData = array_merge($insertData,$updateData);
    }

    /**
     * 验证采集数据是否符合条件
     *
     * @param $data
     * @param $jobInfo
     * @return bool
     */
    private function validateNum($data,$jobInfo){
        $res = true;
        $keys = array_keys($data);
        foreach ($keys as $val){
            if($jobInfo[$val]>$data[$val]){
                $res = false;
                break;
            }
        }
        return $res;
    }

    /**
     * 创建平台类型
     *
     * @param $jobInfo
     * @param $newsTypeId
     */
    private function createType($jobInfo,&$newsTypeId){
        $newType=new NewsType();
        $newsTypeId = [];
        $newsTypeId = $newType->where(['platform'=>$jobInfo['platform']])->column('name,id');
        if(empty($newsTypeId)){
            $insertData=[];
            foreach($this->classNameArr as $val){
                $data['id']=com_create_guid();//生成唯一UUID
                $data['name']=$val;
                $data['platform']=$jobInfo['platform'];
                $data['type']=2;
                $data['status']=1;
                $data['create_time']=time();
                $data['sort']=0;
                $data['is_hot']=1;
                $data['create_by']=$jobInfo['create_by'];
                $data['create_date']=$jobInfo['create_date'];
                $data['update_by']=$jobInfo['update_by'];
                $data['update_date']=$jobInfo['update_date'];
                $insertData[]=$data;
                $newsTypeId[$data['name']] = $data['id'];
            }
            $newType->allowField(true)->insertAll($insertData);
        }
    }

}